public class Solution5 {

    int[] origin;
    int[] nums;
    public Solution5(int[] nums) {
        this.nums = nums;
        origin = new int[nums.length];
        System.arraycopy(nums, 0, origin, 0, nums.length);
    }

    public int[] reset() {
        return origin;
    }

    public int[] shuffle() {
        for (int i = 0; i < nums.length; i++) {
            int j = (int) (Math.random() * (nums.length - i) + i);
            int temp = nums[j];
            nums[j] = nums[i];
            nums[i] = temp;
        }
        return nums;
    }
}
